package com.qf2210.group.three.server.mapper;

import com.qf2210.group.three.pojo.Brand;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author len
* @description 针对表【tb_brand】的数据库操作Mapper
* @createDate 2022-12-01 18:23:17
* @Entity com.qf2210.group.three.pojo.com.qf2210.group.three.server.Brand
*/
@Mapper
public interface BrandMapper extends BaseMapper<Brand> {
    /**
     * 根据多个id查多个品牌
     * @param bId
     * @return List<Brand>
     */

    @Select(
            "SELECT * FROM `tb_brand` \n" +
                    "WHERE brand_id IN (\n" +
                    "SELECT fk_brand_id  FROM `tb_category_brand` \n" +
                    "WHERE fk_category_id=#{bId}\n" +
                    ")\n"
             )
    List<Brand> getall(int bId);
}




